﻿using AutoStar.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace AutoStar.Views.Pages
{
    /// <summary>
    /// SliceParaView.xaml 的交互逻辑
    /// </summary>
    public partial class SliceParaView : Window
    {
        public SliceParaView()
        {
            InitializeComponent();
            DataContext = Global.SliceParaVM;
        }
        public delegate void SliceDelegate(float maxHeight, float minHeight, float precision, int fillMode, float fillInterval, int channel, int solidTime);

        public event SliceDelegate SliceEvent;
        private void Cancel_Click(object sender, RoutedEventArgs e)
        {
            Close();
        }

        private void Ok_Click(object sender, RoutedEventArgs e)
        {
            //SliceEvent(float.Parse(MaxHeight.Text), float.Parse(MinHeight.Text), float.Parse(Accuracy.Text), FillMode.SelectedIndex,
            //    float.Parse(FillInterval.Text), PrintChannel.SelectedIndex, int.Parse(CuringTime.Text));
            SliceEvent(float.Parse(MaxHeight.Text), float.Parse(MinHeight.Text), float.Parse(Accuracy.Text), Global.SliceParaVM.FillModeSelectedIndex,
                float.Parse(FillInterval.Text), PrintChannel.SelectedIndex, int.Parse(CuringTime.Text));
            Close();

        }
    }
}
